﻿// Write a program that reads two dates in the format:
// day.month.year and calculates the number of days between them. 

using System;
using System.Globalization;

public class DatesSubtract
{
    public static void Main()
    {
        string dateFormat = "d.M.yyyy";

        Console.Write("Enter first date ({0}): ", dateFormat);
        string firstDateString = Console.ReadLine();

        Console.Write("Enter second date ({0}): ", dateFormat);
        string secondDateString = Console.ReadLine();

        DateTime firstDate = new DateTime();
        firstDate = DateTime.ParseExact(firstDateString, dateFormat, CultureInfo.InvariantCulture);

        DateTime secondDate = new DateTime();
        secondDate = DateTime.ParseExact(secondDateString, dateFormat, CultureInfo.InvariantCulture);

        string daysBetween = (secondDate - firstDate).TotalDays.ToString();
        Console.WriteLine("Distance: {0} days", daysBetween.Replace("-", string.Empty));
    }
}